import { configureStore } from "@reduxjs/toolkit";
import userReducer, { UserStateType } from "./userReducer";
import componentReducer, { ComponentStateType } from "./componentReducer";
import pageInfoReducer, { PageInfoType } from "./pageInfoReducer";
import undoable, { excludeAction, StateWithHistory } from "redux-undo";
export type StateType = {
  user: UserStateType;
  components: StateWithHistory<ComponentStateType[]>;
  pageInfo: PageInfoType;
};
export default configureStore({
  reducer: {
    user: userReducer,
    components: undoable(componentReducer, {
      limit: 20,
      filter: excludeAction([
        //不排除任何数据 如需要排除加入action.type
      ]),
    }),
    pageInfo: pageInfoReducer,
  },
});
